﻿using Sample.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace Sample.Client
{
    internal class Program
    {
        static void Main(string[] args)
        {
            API.Init("http://localhost:8080");
            var books = API.book.GetList(1000).Result;
            Console.WriteLine(JsonConvert.SerializeObject(books));
            Console.WriteLine();

            var count = API.book.GetCount().Result;
            Console.WriteLine(count.ToString());
            Console.WriteLine();

            var isbook = API.book.IsBook(new Book() { AuthorName = "haibao", Name = "ii", PublishYear = 2022 }).Result;
            Console.WriteLine(isbook.ToString());
            Console.WriteLine();

            Console.ReadKey();
        }
    }
}
